#include <bits/stdc++.h>

using namespace std;

vector<vector<int>> allPathsSourceTarget(vector<vector<int>>& graph);
void dfs(int idx, vector<vector<int>>& graph);

int main()
{
	return 0;
}

vector<int> layer;
vector<vector<int>> res;
vector<vector<int>> allPathsSourceTarget(vector<vector<int>>& graph)
{
	dfs(0, graph);
	return res;
}

void dfs(int idx, vector<vector<int>>& graph)
{
	unsigned length = graph.size();
	if (idx == length) {
		res.push_back(layer);
		return;
	}

	layer.push_back(idx);
	for (auto edge : graph[idx])
		dfs(edge, graph);
	if (idx == length - 1)
		dfs(length, graph);
	layer.pop_back();
}
